<template>
  <div class="action0list">
    <leave-crud title="告警动作" :url="url" :searchOption="searchOption">
      <template slot="tableRows">
        <el-table-column prop="name" label="告警名称"></el-table-column>
        <el-table-column prop="type" label="告警方式">
          <template slot-scope="props">
            {{ type[props.row.type] || '暂无' }}
          </template>
        </el-table-column>
        <el-table-column prop="config.title" label="告警标题" min-width="110px"></el-table-column>
        <el-table-column prop="user.name" label="所属用户"></el-table-column>
        <el-table-column prop="createdAt" label="创建时间" min-width="110px">
          <template slot-scope="props">
            {{ props.row.createdAt | date }}
          </template>
        </el-table-column>
      </template>
    </leave-crud>
  </div>
</template>


<script>
  export default {
    name: 'action0list',
    data() {
      return {
        url: '/action',
        searchOption: [
          {
            'key': 'name',
            'label': '告警名称',
          },
          {
            'key': 'config.title',
            'label': '告警标题',
          },
        ],
        type: {
          0: '邮件告警',
          1: '短信告警',
          2: 'WebHook 告警',
          3: 'WebSocket',
          4: '站内告警',
        },
      }
    },
    methods: {},
    created() {},
  }
</script>


<style lang="scss">
  .action0list {
  }
</style>
